package com.jxpanda.commons.formatter;

import lombok.Getter;

/**
 * 日期格式化的枚举类
 * 枚举常用的日期格式
 *
 * @author Panda
 */
@Getter
public enum DateTimeFormatter {
    /**
     * yyyy-MM-dd HH:mm:ss
     */
    NORMAL_DATE_TIME("yyyy-MM-dd HH:mm:ss"),
    /**
     * yyyy-MM-dd
     * */
    NORMAL_DATE("yyyy-MM-dd"),
    /**
     * HH:mm:ss
     * */
    NORMAL_TIME("HH:mm:ss"),
    /**
     * yyyyMMddHHmmss
     * */
    SEQUENCE_DATE_TIME("yyyyMMddHHmmss"),
    /**
     * yyyyMMdd
     * */
    SEQUENCE_DATE("yyyyMMdd"),
    /**
     * HH:mm
     * */
    HH_MM_TIME("HH:mm");

    private final String pattern;
    private final java.time.format.DateTimeFormatter formatter;

    DateTimeFormatter(String pattern) {
        this.pattern = pattern;
        this.formatter = java.time.format.DateTimeFormatter.ofPattern(pattern);
    }

}
